package com.gkey.demo.http;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gkey.base.web.BaseController;

@Controller
@RequestMapping(value="/htp")
public class HttpNoController extends BaseController {

	@RequestMapping(value="/a1")
	public void abc1(HttpServletRequest request, HttpServletResponse response){
		System.out.println("a1:-----------------------------------------------");
		response.setStatus(302);
		response.addHeader("location", "login.jsp");
	}
	
	@RequestMapping(value="/a2")
	public void abc2(HttpServletRequest request, HttpServletResponse response) throws IOException{
		System.out.println("a2:-----------------------------------------------");
		response.sendRedirect("login.jsp");
	}

	
	
}
